package online.cmagic.createType.builder;

/**
 * 建造者模式
 * @author wangsc
 * @date: 2020年04月12日 14:54
 * @since JDK 1.8
 */
public class TestClient {
    public static void main(String[] args) {
        Car.Builder mBuilder = new Car.Builder()
                .setName("baoma")
                .setColor("red")
                .setSeat()
                .setMoney(1000);
        Car mCar = mBuilder.build();
        Car buildCar = Car.builder()
                .setName("benchi")
                .setColor("black")
                .setSeat()
                .setMoney(2000)
                .build();
        System.out.println(mCar.toString());
        System.out.println(buildCar.toString());
    }
}
